package com.example.wendao.model.entity;

import androidx.annotation.Nullable;
import androidx.databinding.BaseObservable;
import androidx.databinding.Bindable;
import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.Ignore;
import androidx.room.Index;
import androidx.room.PrimaryKey;


@Entity(tableName = "users",indices = {@Index(value={"userId","username"},unique = true)})
public class User extends BaseObservable {

    @PrimaryKey(autoGenerate = true)
    private int userId;

    private String username;

    private String password;

    private String birthday;

    private boolean gender;

    @ColumnInfo(typeAffinity = ColumnInfo.BLOB)
    private byte[] head;

    // 硬币数
    private int coins;

    // 优惠券个数
    private int coupons;

       //累计签到天数（int）
    private int signdays;

       /*收藏新闻id(text逗号隔开)*/
    private String cnewsId = "";

       //收藏论坛id（text逗号隔开）
    private String cforumId = "";

       //点赞新闻id(text 逗号隔开)
    private String anewsId = "";

       //点赞论坛（text 逗号隔开）
    private String aforumId = "";

      //新闻足迹id (text 逗号隔开)
    private String bnewsId = "";

      //论坛足迹id(text 逗号隔开)
    private String bforumId = "";

      //拥有的物品id（text 逗号隔开）
    private String userGoods = "";

    public int getCoupons() {
        return coupons;
    }

    public void setCoupons(int coupons) {
        this.coupons = coupons;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword( String password) {
        this.password = password;
    }

    public String getBirthday() {
        return birthday;
    }

    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }

    public boolean isGender() {
        return gender;
    }

    public void setGender(boolean gender) {
        this.gender = gender;
    }

    public byte[] getHead() {
        return head;
    }

    public void setHead(byte[] head) {
        this.head = head;
    }

    public int getCoins() {
        return coins;
    }

    public void setCoins(int coins) {
        this.coins = coins;
    }

    public int getSigndays() {
        return signdays;
    }

    public void setSigndays(int signdays) {
        this.signdays = signdays;
    }

    public String getCnewsId() {
        return cnewsId;
    }

    public void setCnewsId(String cnewsId) {
        this.cnewsId = cnewsId;
    }

    public String getCforumId() {
        return cforumId;
    }

    public void setCforumId(String cforumId) {
        this.cforumId = cforumId;
    }

    public String getAnewsId() {
        return anewsId;
    }

    public void setAnewsId(String anewsId) {
        this.anewsId = anewsId;
    }

    public String getAforumId() {
        return aforumId;
    }

    public void setAforumId(String aforumId) {
        this.aforumId = aforumId;
    }

    public String getBnewsId() {
        return bnewsId;
    }

    public void setBnewsId(String bnewsId) {
        this.bnewsId = bnewsId;
    }

    public String getBforumId() {
        return bforumId;
    }

    public void setBforumId(String bforumId) {
        this.bforumId = bforumId;
    }

    public String getUserGoods() {
        return userGoods;
    }

    public void setUserGoods(String userGoods) {
        this.userGoods = userGoods;
    }

    @Ignore
    public User(int userId, String username, String password, String birthday, boolean gender, byte[] head, int coins, int signdays, String cnewsId, String cforumId, String anewsId, String aforumId, String bnewsId, String bforumId, String userGoods) {
        this.userId = userId;
        this.username = username;
        this.password = password;
        this.birthday = birthday;
        this.gender = gender;
        this.head = head;
        this.coins = coins;
        this.signdays = signdays;
        this.cnewsId = cnewsId;
        this.cforumId = cforumId;
        this.anewsId = anewsId;
        this.aforumId = aforumId;
        this.bnewsId = bnewsId;
        this.bforumId = bforumId;
        this.userGoods = userGoods;
    }

    public User(){}

    @Override
    public boolean equals(@Nullable Object obj) {
        return super.equals(obj);
    }
}
